(define-module (python gentlsa)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system python)
  #:use-module (gnu packages check)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-crypto)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages tls)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download))

(define-public gentlsa
  (let ((commit "4713ca88cdf328d070252d4b8e61763f66163687")
        (revision "1"))
    (package
      (name "gentlsa")
      (version (git-version "0.1" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/ekollof/gentlsa.git")
               (commit commit)))
         (sha256
          (base32
           "0h63i94x4xg12nsw4az9ip6ds4wii7fnb41wapsv5hvv94ylb4p8"))))
      (build-system gnu-build-system)
      (inputs
       `(("python" ,python)
         ("python-dnspython" ,python-dnspython)
         ("python-docopt" ,python-docopt)
         ("python-m2crypto" ,python-m2crypto)))
      (arguments
       `(#:modules ((guix build gnu-build-system)
                    ((guix build python-build-system) #:prefix python:)
                    (guix build utils))
         #:imported-modules (,@%gnu-build-system-modules
                             (guix build python-build-system))
         #:tests? #f
         #:phases
         (modify-phases %standard-phases
           (delete 'configure)
           (delete 'build)
           (replace 'install
             (lambda* (#:key outputs #:allow-other-keys)
               (let* ((out (assoc-ref outputs "out"))
                      (bin-dir (string-append out "/bin"))
                      (target (string-append bin-dir "/" "gentlsa")))
                 (mkdir-p bin-dir)
                 (copy-file "gentlsa.py" target)
                 (chmod target #o555)
                 #t)))
           (add-after 'install 'wrap-python
             (assoc-ref python:%standard-phases 'wrap)))))
      (synopsis "Tool for dealing with DANE/TLSA records")
      (description
       "Simple tool for dealing with DANE/TSLA records. Also displays info for certificates. Also has optional CloudFlare support.")
      (home-page "https://github.com/ekollof/gentlsa")
      (license license:bsd-2))))

(define-public python-suds-community
  (package
    (name "python-suds-community")
    (version "0.8.4")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "suds-community" version))
        (sha256
          (base32
            "1xnnadsyvhpcz0rd37vg28zh2l5n5ssvkjf06l97skg45b2c7j85"))))
    (build-system python-build-system)
    (native-inputs
     `(("six" ,python-six)
       ("pytest" ,python-pytest)))
    (home-page
      "https://github.com/suds-community/suds")
    (synopsis
      "Lightweight SOAP client (community fork)")
    (description
      "Lightweight SOAP client (community fork)")
    (license license:lgpl3+)))

(define-public python-transip
  (package
    (name "python-transip")
    (version "2.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "transip" version))
       (sha256
        (base32
         "1czpflvmd9iwdq78kcjjb5x02lwhrmrp6jjvbraw9g9zh3lnmip8"))
       (modules '((guix build utils)))
       (snippet
        '(begin
           (substitute* "setup.py"
             (("suds-jurko")
              "suds-community"))
           #t))))
    (build-system python-build-system)
    (arguments
     '(#:tests? #f))
    (propagated-inputs
     `(("python-cryptography" ,python-cryptography)
       ("python-requests" ,python-requests)
       ("python-suds-community" ,python-suds-community)))
    (home-page
     "https://github.com/benkonrath/transip-api")
    (synopsis "TransIP API Connector")
    (description "TransIP API Connector")
    (license license:expat)))

python-transip


